package org.example.mapper;

import org.apache.ibatis.annotations.Param;
import org.example.model.ProductDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LinN
 * @since 2022-10-11
 */
public interface ProductMapper extends BaseMapper<ProductDO> {

    /**
     * 锁定商品库存: 修改product表中的stock和lock_stock
     */
    int lockProductStock(@Param("productId") Long productId, @Param("buyNum") Integer buyNum);

    void unLockProductStock(@Param("productId") Long productId, @Param("buyNum") Integer buyNum);
}
